package nickname

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type NicknamesRouter struct {
}

// InitNicknamesRouter 初始化 Nicknames 路由信息
func (s *NicknamesRouter) InitNicknamesRouter(Router *gin.RouterGroup) {
	nicknamesRouter := Router.Group("nicknames").Use(middleware.OperationRecord())
	nicknamesRouterWithoutRecord := Router.Group("nicknames")
	var nicknamesApi = v1.ApiGroupApp.NicknameApiGroup.NicknamesApi
	{
		nicknamesRouter.POST("createNicknames", nicknamesApi.CreateNicknames)             // 新建Nicknames
		nicknamesRouter.DELETE("deleteNicknames", nicknamesApi.DeleteNicknames)           // 删除Nicknames
		nicknamesRouter.DELETE("deleteNicknamesByIds", nicknamesApi.DeleteNicknamesByIds) // 批量删除Nicknames
		nicknamesRouter.PUT("updateNicknames", nicknamesApi.UpdateNicknames)              // 更新Nicknames

		nicknamesRouter.POST("create", nicknamesApi.NickNamesCreate)
		nicknamesRouter.GET("get", nicknamesApi.NickNamesGet)
	}
	{
		nicknamesRouterWithoutRecord.GET("findNicknames", nicknamesApi.FindNicknames)       // 根据ID获取Nicknames
		nicknamesRouterWithoutRecord.GET("getNicknamesList", nicknamesApi.GetNicknamesList) // 获取Nicknames列表
	}
}
